package com.ms.auto;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.ComponentScan;

import com.auto.task.AutoServiceTask;
import com.auto.task.AutoUpgradeTask;

@ComponentScan("com.*")
@EnableAutoConfiguration(exclude={
		DataSourceAutoConfiguration.class,
		DataSourceTransactionManagerAutoConfiguration.class,
})
@ServletComponentScan("com.*")
@SpringBootApplication
public class MsAutoApplication {
	
	public static void main(String[] args) {
		SpringApplication.run(MsAutoApplication.class, args);
		
		// 启动程序升级服务
		AutoUpgradeTask autoUpgradeTask = new AutoUpgradeTask();
		autoUpgradeTask.run(5, 60);
		// 启动程序服务
		AutoServiceTask autoServiceTask = new AutoServiceTask();
		autoServiceTask.run(10, 120);
		
	}
}